package entity

import "time"
	
type Car struct {
	ID				int			`json:"id"`
	Model			string		`json:"model" binding:"required"`
	RegisteredAt	time.Time	`json:"registered_at" binding:"required"`
	Owner			*User		`json:"owner"`
}

type Cars []*Car

func (c Cars) ToIDs() []int {
	ids := make([]int, 0)
	if c == nil {
		return ids
	}
	
	for _, car := range c {
		ids = append(ids, car.ID)
	}
	return ids
}